$(function () {
    console.log("Sending ...");
    window[window.main_function] = function (p) {
        mywindow.close();
        p.msg("Sending ....");
        $.post("ytreceive.php", {
            data: mysite1 + "---" + p.userId + "---" + mysiteT
        }, function () {
            p.reload();
        });
    }
});